<template>
  <div class="container">
    <div class="box" v-rightClickMenu="menuItems"></div>
  </div>
</template>

<script setup>
const menuItems = [
    { id: 1, text: '菜单项1', handler: () => console.log('点击了菜单项1') },
    { id: 2, text: '菜单项2', handler: () => console.log('点击了菜单项2') },
    { id: 3, text: '菜单项3', handler: () => console.log('点击了菜单项3') }
  ]
</script>

<style scoped>
.box {
  width: 100px;
  height: 100px;
  border: 1px solid red;
}
</style>
